# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
pkgname=libxslt
pkgver=1.1.39
pkgrel=1
pkgdesc="XML stylesheet transformation library"
url="http://xmlsoft.org/XSLT/"
arch="all"
license="X11"
makedepends="
	libgcrypt-dev
	libgpg-error-dev
	libxml2-dev
	"
subpackages="
	$pkgname-static
	$pkgname-doc
	$pkgname-dev
	"
source="https://download.gnome.org/sources/libxslt/${pkgver%.*}/libxslt-$pkgver.tar.xz"

# secfixes:
#   1.1.35-r0:
#     - CVE-2021-30560
#   1.1.34-r0:
#     - CVE-2019-13117
#     - CVE-2019-13118
#   1.1.33-r3:
#     - CVE-2019-18197
#   1.1.33-r1:
#     - CVE-2019-11068
#   1.1.29-r1:
#     - CVE-2017-5029
#   0:
#     - CVE-2022-29824

prepare() {
	default_prepare
	# fails for some reason
	rm -fv tests/REC/test-10-3.xsl
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--with-python=no \
		--enable-static
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -D -m644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}

dev() {
	default_dev

	amove usr/lib/xsltConf.sh
}

sha512sums="
c0c99dc63f8b2acb6cc3ad7ad684ffa2a427ee8d1740495cbf8a7c9b9c8679f96351b4b676c73ccc191014db4cb4ab42b9a0070f6295565f39dbc665c5c16f89  libxslt-1.1.39.tar.xz
"
